package edu.byui.chat;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;

public class LoginCommand implements Sub {

	@SuppressWarnings("unchecked")
	@Override
	public void runSub(ArrayList parameters) {
		String username = (String) ((Command) parameters.get(0)).getUsername();
//		ArrayList<Message> messages = ((Chat) parameters.get(1)).getMessagesFor(username);
//		try {
//			((ObjectOutputStream) parameters.get(2)).writeObject(messages);
//		}
//		catch (SecurityException e) {
//			System.out.println("A SECURITY ERROR prevented the messages from being delivered!");
//			e.printStackTrace();
//		}
//		catch (IOException e) {
//			System.out.println("An IO Exception has prevented the messages from being delivered!");
//			e.printStackTrace();
//		}
//		catch (Exception e) {
//			System.out.println("A GENERIC ERROR has prevented the messages from being delivered!");
//			e.printStackTrace();
//		}		
	}

}
